<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1">
    <link rel="icon" href="image/favicon.ico"
          mce_href="image/favicon.ico" type="image/x-icon">
    <!-- ZUI 标准版压缩后的 CSS 文件 -->
    <link rel="stylesheet"
          href="./zui-1.9.0/css/zui.min.css">
    <link rel="stylesheet" href="./css/demo.css">
    <title>数据监控</title>
    <style>
        .table>tbody>tr>td{
            color: #000000;
        }
    </style>
</head>
<body style="text-align: center;color: #eeeeee;" ctxPath="${ctxPath}">

<div class="col-md-12 col-xs-12" >
<div style="color: red;" >提示:<span id="tip"></span></div>
</div>
<%for(var cbd in cbds){%>
<div class="row" style="text-align: center">
    <div class="col-md-6 col-xs-12" >
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>workStatus</th>
            <th>minCellVolt</th>
            <th>tolVolt</th>
            <th>maxCellVolt</th>
            <th>soc</th>
            <th>workModel</th>
            <th>maxTemp</th>
            <th>dschCurr</th>
            <th>入库时间</th>
        </tr>
        <tbody>
        <tr>
            <td>${cbd.workstatus==1?'运行':cbd.workstatus==0?'故障':cbd.workstatus==2?'停止':'未知'}</td>
            <td>${cbd.mincellvolt}</td>
            <td>${cbd.tolvolt}</td>
            <td>${cbd.maxcellvolt}</td>
            <td>${cbd.soc}</td>
            <td>${cbd.workmodel}</td>
            <td>${cbd.maxtemp}</td>
            <td>${cbd.dschcurr}</td>
            <td>${cbd.createtime,dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
        </tr>
        </tbody>
    </table>
</div>
</div>
<%}%>

<!--<div style="margin:0 auto;height: 400px;width: 400px;">
    <div style="margin:30px">
        <a class="btn btn-lg  btn-primary"
           type="button" href="${ctxPath}/index"
           target="_blank">首页
        </a>
    </div>
    <div style="margin:30px">
        <a class="btn btn-lg  btn-primary"
           type="button" href="${ctxPath}/cmd"
           target="_blank">调度优化
        </a>
    </div>
    <div style="margin:30px">
        <a class="btn btn-lg  btn-primary"
           type="button" href="${ctxPath}/irouter"
           target="_blank">iRouter本地监控界面
        </a>
    </div>
    <div style="margin:30px">
        <a class="btn btn-lg  btn-primary"
           type="button" id="btnImport">Excel导入
        </a>
        <form id="fileForm" action="${ctxPath}/import" method="post"
              enctype="multipart/form-data">
            <input type="file" name="file"
                   style="display: none" id="fileChoose"/>
        </form>
    </div>

</div>-->

<!--<textarea id="contentSimple" name="content"
          class="form-control kindeditorSimple"
          style="height:150px;display: none;">Hello, world!</textarea>-->


<script src="./zui-1.9.0/lib/jquery-1.11.0.min.js"></script>
<script src="./layer/layer.js"></script>
<script src="./zui-1.9.0/js/zui.min.js"></script>
<script src="./zui-1.9.0/lib/kindeditor/kindeditor.min.js"></script>
<script src="./js/lib/jquery-form.js"></script>
<script type="text/javascript">
    let t= 20;
    setInterval("refer()",1000);
    function refer(){
        if(t==0){
            window.location.reload();
        }
        document.getElementById('tip').innerHTML=""+t+"秒后刷新";
        t--;
    }
</script>


<!--<script>
    KindEditor.create('textarea.kindeditorSimple', {
        basePath: 'zui-1.9.0/lib/kindeditor/',
        bodyClass: 'article-content',     // 确保编辑器内的内容也应用 ZUI 排版样式
        cssPath: 'zui-1.9.0/css/zui.min.css', // 确保编辑器内的内容也应用 ZUI 排版样式
        resizeType: 1,
        allowPreviewEmoticons: false,
        allowImageUpload: false,

    });

    $(function () {
        $('#btnImport').on('click',function () {
            $('#fileChoose').click();
        })

        $('#fileChoose').on('input propertychange',function () {
            if($(this).val()){
                var form = $(this).closest('form');
                var index = layer.load(1,{shade:[0.5,'#ccc']})
                if(!$(this)[0].files[0].name.toLowerCase().endsWith('.xlsx')){
                    layer.close(index);
                    layer.alert('您上传的文件格式不正确，请先下载模板后导入！');
                    return;
                }
                if($(this)[0].files[0].size>10485760){
                    layer.close(index);
                    layer.alert('文件不能大于10M');
                    return;
                }
                var formAjax = form.ajaxSubmit();
                console.log($(this)[0].files[0])
                var xhr = formAjax.data('jqxhr');
                xhr.done(function(res) {
                    console.log(res);
                    layer.close(index);
                    layer.alert('done!');
                }).fail(function(err) {
                    console.error(err.responseJSON);
                    layer.close(index);
                    layer.alert('网络异常！')
                });
            }
            $('#fileChonse').val('');

        })
    })


</script>-->
</body>
</html>